package cn.daniellee.plugin.awa.command;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.HumanEntity;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class MissionCompleter implements TabCompleter {

	private final String[] subCommands = {"reload"};

	@Override
	public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] strings) {
		if (strings.length == 0) return Arrays.asList(subCommands);
		else if (strings.length == 1) return Arrays.stream(subCommands).filter(string -> string.startsWith(strings[0])).collect(Collectors.toList());
		return new ArrayList<>();
	}

}
